Modern computer operating systems host a number of services that require communications with internal and external clients. A service is an application or process that carries out some task on behalf of the client. Examples of services are, but not limited to: window services, directory services, web, email, file transfer, streaming audio and/or video, etc. Each service communicates with its clients through a communication handle. A communication handle is an identifier for a communication channel between the service and its client. Examples of communication handles are: sockets, Mach ports, file handles, pipes, etc.
Many services employing communication handles use the same structure to process initial communication requests from a client to a service. Consequently, development of standard programs assumed the processing of the common client communication requests to the services. Two mechanisms arose in UNIX-based operating systems, inetd and mach_init. Inetd is a program that launches services on demand. Furthermore, inetd listens for communication connections to the services made on Internet Protocol (IP) sockets. When a connection is made, inetd searches through its list of known services and passes the connection to proper service.
However, inetd is limited in several respects. First, inetd typically only handles communications on IP sockets. Second, inetd generally only allows a service to receive communications on one port. For example, a web server service can handle communications on ports 80 (HyperText Transfer Protocol (HTTP) for web page communications) and 443 (secure HTTP, or HTTPS). Thus, to use the web server service under inetd usually requires two running instances of web server service: one for HTTP communications and one for HTTPS communications. Having two web server services running wastes computer resources when one service could handle both types of service requests. In addition, inetd launches services on demand. Finally, inetd supports a limited form of input because a small number of parameters can be passed to a service when inetd starts the service. Thus, if a service uses a new input type passed through inetd, inetd needs to be modified to support the new input type.
Mach_init is similar to inetd except that mach_init listens for communications made on Mach ports. Mach_init maintains mappings between services and Mach ports that provide access to those services. In addition, mach_init launches the services on demand when a client requests a service and the service is not running. However, while mach_init supports multiple Mach ports per service, mach_init only monitors communications on Mach ports. Furthermore, mach_init does not support customizing service attributes or the service running environment.